import App from "./App";
import { createSSRApp } from "vue";
import uviewPlus from "uview-plus";

// 工具
import "@/plugins/utils.js";
//权限配置中心
import base from "@/config/baseUrl";
//数据管理中心
// import store from "@/store";
//挂载全局http请求
import $http from "@/config/requestHttp.js";
//判断是否登录
// import { judgeLogin } from "@/config/login";
import Commond from "./utils/commond.js";
import onMultClick from "./utils/onMultClick.js";

const CommonPlugin = {
  install(app) {
    // app.config.globalProperties.$store = store;
    app.config.globalProperties.$base = base;
    app.config.globalProperties.$http = $http;
    // app.config.globalProperties.judgeLogin = judgeLogin;
    app.config.globalProperties.Commond = new Commond();
    app.config.globalProperties.onMultClick = onMultClick.onMultClick;
  },
};

//挂载全局方法
export function createApp() {
  const app = createSSRApp(App);
  app.use(uviewPlus);
  app.use(CommonPlugin);
  return {
    app,
  };
}
